#!/usr/bin/env python

from nacl.public import PrivateKey, PublicKey
from nacl.encoding import Base64Encoder
import sys


def main():
	if len(sys.argv) >= 2:
		private_key = PrivateKey(sys.argv[1], Base64Encoder)
	else:
		private_key = PrivateKey.generate()
	public_key = private_key.public_key
	print("curve25519 private key: %s" % private_key.encode(Base64Encoder))
	print("curve25519 public key: %s" % public_key.encode(Base64Encoder))


if __name__ == '__main__':
	main()
